package com.swust.course.service.impl;

import java.util.List;
import com.swust.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.swust.course.mapper.CourseTechMapper;
import com.swust.course.domain.CourseTech;
import com.swust.course.service.ICourseTechService;

/**
 * 授课Service业务层处理
 * 
 * @author LiuShuai
 * @date 2024-04-05
 */
@Service
public class CourseTechServiceImpl implements ICourseTechService 
{
    @Autowired
    private CourseTechMapper courseTechMapper;

    /**
     * 查询授课
     * 
     * @param createBy 授课主键
     * @return 授课
     */
    @Override
    public CourseTech selectCourseTechByCreateBy(String createBy)
    {
        return courseTechMapper.selectCourseTechByCreateBy(createBy);
    }

    /**
     * 查询授课列表
     * 
     * @param courseTech 授课
     * @return 授课
     */
    @Override
    public List<CourseTech> selectCourseTechList(CourseTech courseTech)
    {
        return courseTechMapper.selectCourseTechList(courseTech);
    }

    /**
     * 新增授课
     * 
     * @param courseTech 授课
     * @return 结果
     */
    @Override
    public int insertCourseTech(CourseTech courseTech)
    {
        courseTech.setCreateTime(DateUtils.getNowDate());
        return courseTechMapper.insertCourseTech(courseTech);
    }

    /**
     * 修改授课
     * 
     * @param courseTech 授课
     * @return 结果
     */
    @Override
    public int updateCourseTech(CourseTech courseTech)
    {
        courseTech.setUpdateTime(DateUtils.getNowDate());
        return courseTechMapper.updateCourseTech(courseTech);
    }

    /**
     * 批量删除授课
     * 
     * @param createBys 需要删除的授课主键
     * @return 结果
     */
    @Override
    public int deleteCourseTechByCreateBys(String[] createBys)
    {
        return courseTechMapper.deleteCourseTechByCreateBys(createBys);
    }

    /**
     * 删除授课信息
     * 
     * @param createBy 授课主键
     * @return 结果
     */
    @Override
    public int deleteCourseTechByCreateBy(String createBy)
    {
        return courseTechMapper.deleteCourseTechByCreateBy(createBy);
    }
}
